//
//  LGOutpatientRecordDetailCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/7/12.
//

#import "LGOutpatientRecordDetailCell.h"

@interface LGOutpatientRecordDetailCell()
/**   */
@property (nonatomic , strong)UIView *baseView;
/**   */
@property (nonatomic , strong)UIButton *titleBtn;
/**   */
@property (nonatomic , strong)UILabel *chiefTitle;
/**   */
@property (nonatomic , strong)UILabel *chiefContent;
/**   */
@property (nonatomic , strong)UILabel *presentTitle;
/**   */
@property (nonatomic , strong)UILabel *presentContent;
/**   */
@property (nonatomic , strong)UILabel *maritalTitle;
/**   */
@property (nonatomic , strong)UILabel *maritalContent;
/**   */
@property (nonatomic , strong)UILabel *menstrualTitle;
/**   */
@property (nonatomic , strong)UILabel *menstrualContent;
/**   */
@property (nonatomic , strong)UILabel *familyTitle;
/**   */
@property (nonatomic , strong)UILabel *familyContent;
/**   */
@property (nonatomic , strong)UILabel *physicalTitle;
/**   */
@property (nonatomic , strong)UILabel *physicalContent;
/**   */
@property (nonatomic , strong)UILabel *auxiliaryTitle;
/**   */
@property (nonatomic , strong)UILabel *auxiliaryContent;
/**   */
@property (nonatomic , strong)UILabel *diagnosisTitle;
/**   */
@property (nonatomic , strong)UILabel *diagnosisContent;
/**   */
@property (nonatomic , strong)UILabel *suggestionTitle;
/**   */
@property (nonatomic , strong)UILabel *suggestionContent;
/**   */
@property (nonatomic , strong)UILabel *remarkTitle;
/**   */
@property (nonatomic , strong)UILabel *remarkContent;
@end

@implementation LGOutpatientRecordDetailCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return  self;
}

-(void)setDataDic:(NSDictionary *)dataDic{
    _dataDic = dataDic;
    self.chiefContent.text = LGNSString(dataDic[@"chief_complaint"]);
    self.presentContent.text = LGNSString(dataDic[@"present_illness"]);
    self.familyContent.text = LGNSString(dataDic[@"family_history"]);
    self.maritalContent.text = LGNSString(dataDic[@"marital_history"]);
    self.physicalContent.text = LGNSString(dataDic[@"physical_examination"]);
    self.auxiliaryContent.text = LGNSString(dataDic[@"auxiliary_examination"]);
    self.diagnosisContent.text = LGNSString(dataDic[@"diagnosis"]);
    self.suggestionContent.text = LGNSString(dataDic[@"suggestion"]);
    self.remarkContent.text = LGNSString(dataDic[@"departure_suggestion"]);
}


-(void)createSubView{
    self.contentView.backgroundColor = [UIColor colorWithString:@"#F9F9F9"];
    [self.contentView addSubview:self.baseView];
    [self.baseView addSubview:self.titleBtn];
    [self.baseView addSubview:self.chiefTitle];
    [self.baseView addSubview:self.chiefContent];
    [self.baseView addSubview:self.presentTitle];
    [self.baseView addSubview:self.presentContent];
    [self.baseView addSubview:self.familyTitle];
    [self.baseView addSubview:self.familyContent];
    [self.baseView addSubview:self.maritalTitle];
    [self.baseView addSubview:self.maritalContent];
    [self.baseView addSubview:self.physicalTitle];
    [self.baseView addSubview:self.physicalContent];
    [self.baseView addSubview:self.auxiliaryTitle];
    [self.baseView addSubview:self.auxiliaryContent];
    [self.baseView addSubview:self.diagnosisTitle];
    [self.baseView addSubview:self.diagnosisContent];
    [self.baseView addSubview:self.suggestionTitle];
    [self.baseView addSubview:self.suggestionContent];
    [self.baseView addSubview:self.remarkTitle];
    [self.baseView addSubview:self.remarkContent];
    [self.baseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(viewPix(8));
        make.left.equalTo(self.contentView).offset(viewPix(16));
        make.right.equalTo(self.contentView).offset(-viewPix(16));
        make.bottom.equalTo(self.contentView).offset(-viewPix(8));
    }];
    [self.chiefTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.baseView).offset(viewPix(16));
        make.right.equalTo(self.baseView).offset(-viewPix(12));
        make.top.equalTo(self.baseView).offset(viewPix(56));
    }];
    [self.chiefContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.chiefTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.presentTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.chiefContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.presentContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.presentTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.familyTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.presentContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.familyContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.familyTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.maritalTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.familyContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.maritalContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.maritalTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.physicalTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.maritalContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.physicalContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.physicalTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.auxiliaryTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.physicalContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.auxiliaryContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.auxiliaryTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.diagnosisTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.auxiliaryContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.diagnosisContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.diagnosisTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.suggestionTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.diagnosisContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.suggestionContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.suggestionTitle.mas_bottom).offset(viewPix(7));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.remarkTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.suggestionContent.mas_bottom).offset(viewPix(11));
        make.left.right.equalTo(self.chiefTitle);
    }];
    [self.remarkContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.remarkTitle.mas_bottom).offset(viewPix(7));
        make.bottom.equalTo(self.baseView).offset(-viewPix(16));
        make.left.right.equalTo(self.chiefTitle);
    }];
   
}


-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.1 radius:15];
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UIButton *)titleBtn{
    if(!_titleBtn){
        _titleBtn = [UIButton buttonWithTitle:@"病历内容" titleFont:LGFontWeight(16, UIFontWeightMedium) textColor:@"#1F6CC6" imageName:@""];
        [_titleBtn setBackgroundImage:[UIImage imageNamed:@"就诊检查-蓝色"] forState:UIControlStateNormal];
        _titleBtn.frame = CGRectMake(0, viewPix(20), 112, 27);
        _titleBtn.userInteractionEnabled = NO;
    }
    return _titleBtn;
}


-(UILabel *)chiefTitle{
    if(!_chiefTitle){
        _chiefTitle = [UILabel lableWithText:@"主诉：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _chiefTitle;
}

-(UILabel *)chiefContent{
    if(!_chiefContent){
        _chiefContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _chiefContent;
}

-(UILabel *)presentTitle{
    if(!_presentTitle){
        _presentTitle = [UILabel lableWithText:@"病史：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _presentTitle;
}

-(UILabel *)presentContent{
    if(!_presentContent){
        _presentContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _presentContent;
}

-(UILabel *)familyTitle{
    if(!_familyTitle){
        _familyTitle = [UILabel lableWithText:@"家族史：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _familyTitle;
}

-(UILabel *)familyContent{
    if(!_familyContent){
        _familyContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _familyContent;
}

-(UILabel *)maritalTitle{
    if(!_maritalTitle){
        _maritalTitle = [UILabel lableWithText:@"婚姻史：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _maritalTitle;
}

-(UILabel *)maritalContent{
    if(!_maritalContent){
        _maritalContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _maritalContent;
}

-(UILabel *)physicalTitle{
    if(!_physicalTitle){
        _physicalTitle = [UILabel lableWithText:@"体格检查：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _physicalTitle;
}

-(UILabel *)physicalContent{
    if(!_physicalContent){
        _physicalContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _physicalContent;
}

-(UILabel *)auxiliaryTitle{
    if(!_auxiliaryTitle){
        _auxiliaryTitle = [UILabel lableWithText:@"辅助检查：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _auxiliaryTitle;
}

-(UILabel *)auxiliaryContent{
    if(!_auxiliaryContent){
        _auxiliaryContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _auxiliaryContent;
}

-(UILabel *)diagnosisTitle{
    if(!_diagnosisTitle){
        _diagnosisTitle = [UILabel lableWithText:@"诊断：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _diagnosisTitle;
}

-(UILabel *)diagnosisContent{
    if(!_diagnosisContent){
        _diagnosisContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _diagnosisContent;
}

-(UILabel *)suggestionTitle{
    if(!_suggestionTitle){
        _suggestionTitle = [UILabel lableWithText:@"处理意见：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _suggestionTitle;
}

-(UILabel *)suggestionContent{
    if(!_suggestionContent){
        _suggestionContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _suggestionContent;
}

-(UILabel *)remarkTitle{
    if(!_remarkTitle){
        _remarkTitle = [UILabel lableWithText:@"离院建议：" colorString:@"#333333" textFont:LGFontWeight(15, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _remarkTitle;
}

-(UILabel *)remarkContent{
    if(!_remarkContent){
        _remarkContent = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(15) textAlignment:NSTextAlignmentLeft lines:0];
    }
    return _remarkContent;
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
